<!DOCTYPE html>
<html lang="zh"  xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
  <title>管理员后台</title>
  <link rel="icon" href="/behindstatic/images/favicon.ico" type="image/ico">
  <meta name="keywords" content="管理员后台">
  <meta name="description" content="管理员后台">
  <meta name="author" content="yinqi">


  <link href="/behindstatic/css/bootstrap.min.css" rel="stylesheet">
  <link href="/behindstatic/css/materialdesignicons.min.css" rel="stylesheet">
  <link href="/behindstatic/css/style.min.css" rel="stylesheet">
</head>
  
<body>
<div class="lyear-layout-web">
  <div class="lyear-layout-container">
    <!--引入左侧导航页面-->
    <nav th:replace="~{admin/left   ::  leftside(cl='se')}"></nav>
    <!--引入头部导航页面-->
    <nav th:replace="~{admin/header  ::  headerside}"></nav>

    <!--页面主要内容-->
    <main class="lyear-layout-content">
      
      <div class="container-fluid">
        
        <div class="row">
          <div class="col-lg-12">
            <div class="card">
              <div class="card-toolbar clearfix">
                <form  action="/admin/sectionList" class="pull-right search-bar" method="get"  role="form" style="margin: 0 30%">
                  <div class="input-group" style="left: -52%;">
                     <input type="text" class="form-control"  name="name"  th:value="${section.name}"  placeholder="请输入名称">
                     <input type="hidden" name="page" id="search-field"  th:value="${pageInfo.pageNum}">
                     <div class="input-group-btn">
                      <button  id="tijiao" type="button" class="btn btn-default dropdown-toggle"  >
                        <i class="mdi mdi-magnify">  </i>
                      </button>
                    </div>
                  </div>
                </form>
                <div class="toolbar-btn-action">
                  <a class="btn btn-primary m-r-5"   th:href="@{/admin/sectionAddPage}"><i class="mdi mdi-plus"></i>添加科室</a>
                </div>
              </div>
              <div class="card-body">
                
                <div class="table-responsive">
                  <table class="table table-bordered">
                    <thead>
                      <tr>
                        <th>科室名称</th>
                        <th>科室详情</th>
                        <th>操作</th>
                      </tr>
                    </thead>
                    <tbody>
                      <tr th:each=" list : ${sectionList}">
                        <td style="width: 33%;">[[${list.name}]]</td>
                        <td style="width: 33%;">  
                             <select class="form-control" id="example-select" >
		                        <option  th:each="se : ${list.slist}"   th:value="${se.id}"   >[[${se.name}]]</option>
                           </select>
                        </td>
                        <td style="width: 33%;">
                          <div class="btn-group">
                              <!--   <a class="btn btn-default btn-sm"   th:href="@{/admin/sectionBelowList(id=${list.id})}"><i class="mdi mdi-library-plus"></i>添加分类</a> -->                          
                             <a class="btn btn-default btn-sm"   th:href="@{/admin/sectionAddBelowPage(id=${list.id})}"><i class="mdi mdi-library-plus"></i>添加分类</a>                         

                            <a class="btn btn-primary btn-sm"   th:href="@{/admin/sectionUptatePage(id=${list.id})}"><i class="mdi mdi-plus"></i> 修改</a>
                            <a class="btn btn-danger  btn-sm"   th:href="@{/admin/sectionDelect(id=${list.id})}"><i class="mdi mdi-window-close"></i> 删除</a>
                          </div>
                        </td>
                      </tr>

                    </tbody>
                  </table>
                </div>
                <ul class="pagination">
                  <li class="active">
                    <a th:href="@{/admin/sectionList(page=1)}">首页</a>
                  </li>
                  <li>
                    <a th:href="@{/admin/sectionList(page=${pageInfo.hasPreviousPage}?${pageInfo.prePage}:1,type=${section.name})}">上一页</a>
                  </li>
                  <li >
                    <span style="border:0px solid #ddd;">
                     [[${pageInfo.pageNum}]]页 /
                     [[${pageInfo.pages}]]页
                    </span>
                  </li>
                  <li>
                    <a th:href="@{/admin/sectionList(page=${pageInfo.hasNextPage}?${pageInfo.nextPage}:${pageInfo.pages},name=${section.name})}">下一页</a>
                  </li>
                  <li class="active">
                    <a th:href="@{/admin/sectionList (page=${pageInfo.pages})}">尾页</a>
                  </li>
                </ul>
       
              </div>
            </div>
          </div>
          
        </div>
        
      </div>
      
    </main>
    <!--End 页面主要内容-->
  </div>
</div>
<script type="text/javascript" src="/behindstatic/js/jquery.min.js"></script>
<script type="text/javascript" src="/behindstatic/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/behindstatic/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="/behindstatic/js/main.min.js"></script>
<script type="text/javascript">
  $(function(){
      $('.search-bar .dropdown-menu a').click(function() {
          var field = $(this).data('field') || '';
          $('#search-field').val(field);
          $('#search-btn').html($(this).text() + ' <span class="caret"></span>');
      });

    $('#tijiao').click(function() {
      var sou = $('#sou').val();
      if( sou != null && sou != ""){
        var ban = /^[a-zA-Z]+$/.test(sou);
        if(!ban){
          alert("请输入字母");
          return;
        }
       }
      $("form").submit();
    });

  });
</script>
</body>
</html>